import { useState } from "react";
import { Button, Radio, Modal } from "antd"
import EditColumns from '../components/EditColumns';
import SetRemarkBack from "../components/SetRemarkBack";
import ChildAccountAuth from '../components/ChildAccountAuth';
import HandleResultQuery from '../components/HandleResultQuery';
import IconFont from '@/components/IconFont';

//右侧操作区
const RightAction = ({ initColumns, realColumns, orderBy, setOrderBy, updatePageConfig }) => {

	//设置列信息
	const [visible, setVisible] = useState();

	//列设置props
	const EditColumnsProps = {
		initColumns,
		realColumns,
		updatePageConfig,
		handleCancel() {
			setVisible(null);
		},
		handleOk() {
			setVisible(null);
		},
	}

	//设置备注回传规则
	const SetRemarkBackProps = {
		handleCancel() {
			setVisible(null);
		}
	}

	//设置备注回传规则
	const ChildAccountAuthProps = {
		handleCancel() {
			setVisible(null);
		}
	}

	const ceshi = () => {
		Modal.info({
			content: 'ZHESHICESHINEIRONG'
		})
	}

	return (
		<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
				<Radio.Group value={orderBy} onChange={e => setOrderBy(e.target.value)} buttonStyle="solid">
					<Radio.Button value="applyTime">后申请的在前</Radio.Button>
					<Radio.Button value="processingTimeRemain">快超时的在前</Radio.Button>
				</Radio.Group>
				<div>
					<Button type="text" onClick={() => setVisible('HandleResultQuery')}>处理结果查询</Button>
					{/* <Button type="text" onClick={ceshi}>ceshi </Button> */}
					<Button type="text" onClick={() => setVisible('ChildAccountAuth')}>子账号授权</Button>
					<Button type="text" onClick={() => setVisible('setRemarkBack')}>备注回传规则</Button>
					<Button type="text" onClick={() => setVisible('setColumns')}>
						<IconFont type="icona-lujing12" />
						列表设置
					</Button>
				</div>
			{visible == 'setColumns' && <EditColumns {...EditColumnsProps} />}
			{visible == 'setRemarkBack' && <SetRemarkBack {...SetRemarkBackProps} />}
			{visible == 'ChildAccountAuth' && <ChildAccountAuth {...ChildAccountAuthProps} />}
			{visible == 'HandleResultQuery' && <HandleResultQuery {...SetRemarkBackProps} />}
		</div>
	)
}

export default RightAction;